﻿package phpas3{
	public function isset(variable:*, ...properties):Boolean {
	    if (variable!=null && variable!=undefined) {
	        var length:int = properties.length;

	        if (properties.length>0) {
	            var reference:* = variable;

	            for (var i:int=0; i<length; i++) {
	                var property:String = properties[i];
	                if (Object(reference).hasOwnProperty(property)) {
	                    reference = reference[property];
	                }
	                else {
	                    return false;
	                }
	            }
	        }
	        return true;
	    }
	    else {
	        return false;
	    }
	}
}